package com.hyperfix.washer.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hyperfix.models.washer.pojos.Monitor;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author JiangChunYu
 * 2024/4/11
 */
@Mapper
public interface MonitorMapper extends BaseMapper<Monitor> {
    @Insert("insert monitor(user_id, pipeline_id, update_time) values (#{userId}, (select id from pipeline limit 1), NOW())")
    boolean saveByFirstPipeline(@Param("userId") Integer userId);
}
